home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_10.lha
/
7_10
/
7_10po.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
1KB
|
57 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ typedefs to ease some declarations
ypedef void (*PVFPC)(char*);
ypedef void (*PVFV)();
/ for maintaining a list of processes
lass process_link
friend class process_object;
process *pl_process;
process_link *pl_next;
process_link(process *t, process_link *pl)
{ pl_process = t; pl_next = pl; }
;
/ The basis of the process system.
lass process_object
/ protected:
riend class process;
riend class queue_head;
riend class queue_tail;
process_object *po_next; // to chain process_objects
process_link *po_link; // the process memory
// user-supplied error function
static void (*po_error_fct)(char*);
ublic:
process_object() { po_next = 0; po_link = 0; }
~process_object();
// return T if object is not available yet
virtual int pending();
// add process to object's memory
void remember(process *t)
{ po_link = new process_link(t, po_link); }
// reschedule all idle remembered processes
void alert();
// remove process from object's memory
void forget(process *);
// main error function
void error(char*);
// allow user to set po_error_fct
PVFPC set_error_function(PVFPC);
virtual ostream &print(ostream&); // DELETE
;